package com.yizhiliulianta.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yizhiliulianta.usercenter.model.User;
import jakarta.servlet.http.HttpServletRequest;
import com.yizhiliulianta.usercenter.model.request.userModifyRequest;

import java.util.List;

/**
* @author yizhiliulianta
* @description 针对表【user】的数据库操作Service
* @createDate 2024-05-01 22:40:17
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @param userAccount 用户账号
     * @param userPassword 用户密码
     * @param checkPassword 用户二次验证密码
     * @return 用户id
     */
    long userRegister(String userAccount, String userPassword, String checkPassword);

    /**
     * 用户登录
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @return 返回脱敏用户信息
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);

    List<User> searchUsers(String username);

    boolean deleteUser(long id);

    User getSafetyUser(User orginUser);

    //用户注销
    int userLogout(HttpServletRequest request);

    Boolean userModify(userModifyRequest userModifyRequest,HttpServletRequest request);
}
